package com.ruoyi.system.enums;

/**
 * description: 梦网短信发送错误信息枚举
 * date: 2021/7/6
 * author: tmac-1
 * version: 1.0
 */
public enum MwSmsErrorEnum {
    ZERO("0", "发送成功"),
    ONE("-100001", "鉴权不通过,请检查账号,密码,时间戳,固定串,以及MD5算法是否按照文档要求进行设置"),
    TWO("-100002", "用户多次鉴权不通过,请检查账号,密码,时间戳,固定串,以及MD5算法是否按照文档要求进行设置"),
    THREE("-100003", "用户欠费"),
    FOUR("-100004", "custid或者exdata字段填写不合法"),
    FIVE("-100011", "短信内容超长"),
    SIX("-100012", "手机号码不合法"),
    SEVEN("-100014", "手机号码超过最大支持数量（1000）"),
    EIGTH("-100029", "端口绑定失败"),
    NINE("-100056", "用户账号登录的连接数超限"),
    TEN("-100057", "用户账号登录的IP错误"),
    ELEVEN("-100126", "短信有效存活时间无效"),
    TWELVE("-100252", "业务类型不合法(超长或包含非字母数字字符)"),
    THIRTEEN("-100253", "自定义参数超长"),
    FOURTEEN("-100999", "平台数据库内部错误");

    private String errorCode;
    private String errorMsg;

    MwSmsErrorEnum(String errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public static String getErrorMsg(String errorCode) {
        for (MwSmsErrorEnum c : MwSmsErrorEnum.values()) {
            if (c.errorCode.equals(errorCode)) {
                return c.errorMsg;
            }
        }
        return "未知编码[" + errorCode + "]";
    }
}
